This invention relates to systems and methods for correcting defect pixels in a digital image (for example, a digital still image, a digital video image, or both).
Digital images are formed from an array of pixels (picture elements), each pixel having an assigned color and intensity. A digital image may be captured by a charged-coupled device (CCD) with a planar array of photodetectors. Each photodetector is located at a respective pixel position. Defective photodetectors produce imperfections in the corresponding pixel locations in the resulting digital image. Although CCD manufacturers have reduced the photodetector defect rate significantly, elimination of all defects typically is not practical. Consequently, manufacturers of digital imaging devices generally include systems designed to correct imperfections caused by photodetector defects. Various correction systems have been proposed. Some correction systems include image processors designed to interpolate the correct values of defect pixels based upon the values of non-defective neighboring pixels. Such correction systems may be classified as directional interpolation systems, or non-directional averaging (or erosion) systems. For example, in one proposed directional interpolation system, a defect pixel value is obtained by linear interpolation of a line of pixels that extends through the defect pixel and is oriented in a direction determined from gradient information derived from the pixels neighboring the defect pixel. Typical non-directional averaging systems tend to be easier to implement; however, they also tend to overly smooth non-edge image areas and significantly distort edges in the corrected image.
The invention features improved systems and methods of correcting one or more defect pixels in a source image formed from a plurality of pixels each having a respective value.
In one aspect, the invention features a scheme in which a defect pixel is corrected based upon curvature information computed from pixel values located near the defect pixel.
Embodiments may include one or more of the following features.
The defect pixel preferably is corrected by interpolating values of pixels aligned with the defect pixel in an interpolation direction determined from the curvature information. The interpolation direction may be determined by comparing curvature values computed for two orthogonal directions. The interpolation direction preferably corresponds to the direction having the lower curvature value. The defect pixel preferably is assigned a value computed from a linear interpolation of values of pixels aligned with the defect pixel along the interpolation direction. The defect pixel may be assigned a value computed from a linear interpolation of values of two non-defective pixels located on opposite sides of the defect pixel. The assigned defect pixel value may be computed from the operations of adding and shifting.
The defect pixel may be corrected based upon curvature information computed for two different image directions. For example, a horizontal curvature value may be computed based upon pixel values from two groups of horizontally aligned pixels located on opposite sides of the defect pixel. A vertical curvature value may be computed based upon pixel values from two groups of vertically aligned pixels located on opposite sides of the defect pixel. Alternatively, curvature values may be computed based upon values of pixels surrounding the defect pixel. The defect pixel may be corrected based upon a comparison of the computed curvature values. For example, the defect pixel may be corrected by interpolating values of pixels aligned vertically with the defect pixel in response to a determination that the horizontal curvature exceeds the vertical curvature.
Alternatively, the defect pixel may be corrected by interpolating values of pixels aligned horizontally with the defect pixel in response to a determination that the vertical curvature exceeds the horizontal curvature.
The source image may be obtained from an image sensor having a plurality of light detectors each generating a pixel value of a respective color, wherein the colors are arranged in multiple color planes of non-overlapping pixel locations. The defect pixel may be corrected based upon curvature information computed from values of pixels in the same color plane.
In another aspect, the invention features a scheme in which a median pixel value is determined from values of pixels on the same color plane located near a defect pixel, and the defect pixel is corrected based upon the median pixel value.
Embodiments may include one or more of the following features.
The median pixel value preferably is determined from values of pixels on the same color plane adjacent to the defect pixel. A difference value representative of the difference between the defect pixel value and the computed median pixel value may be computed, and the defect pixel may be corrected by replacing the defect pixel value with the median value in response to a determination that the difference value exceeds a threshold value.
Among the advantages of the invention are the following.
The curvature-based directional interpolation invention provides a robust and efficient scheme for recovering corrupted pixel data in both low frequency (smooth) areas and high frequency (edge and corner) areas of the source image. The median filter invention, on the other hand, provides an efficient scheme for recovering corrupted pixel data on the fly, especially when the locations of defects are not known beforehand. The median filter invention effectively removes outliers (i.e., adjacent defect pixels), while substantially preserving edges and corners in the source image.